package com.cgy.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import util.PoiHandler;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name="computer")
public class Computer {

	@Id
	@PoiHandler(excelHeader = "电脑编号",excelIgnore = true)
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer cid; //电脑编号 
	@PoiHandler(excelHeader = "电脑名称")
	private String cname;//电脑名称 
	@PoiHandler(excelHeader = "电脑ip")
	private String cip;//电脑ip地址
	@PoiHandler(excelHeader = "电脑状态")
	@Column(name = "c_status",unique = true)
	private Integer cstatus;//状态 
	@PoiHandler(excelHeader = "电脑备注")
	@Column(name = "c_remark",unique = true)
	private String cRemark;//备注
	@ManyToOne(fetch=FetchType.EAGER)   
	@PoiHandler(excelHeader = "所属机房")
	@JoinColumn(name="zid")
	private ZiYuan ziYuan; //电脑机房
	
}
